import http from './http'

export const userLogin = (data) => http.post('/users/login', data)
export const userRegister = (data) => http.post('/users/register', data)
export const changePassword = (data) => http.post('/users/change-password', data)
export const getUser = (userId) => http.get(`/users/${userId}`)
export const updateUser = (userId, data) => http.put(`/users/${userId}`, data)

export const createOrder = (userId, order) => http.post(`/users/${userId}/orders`, order)
export const getUserOrders = (userId, params) => http.get(`/users/${userId}/orders`, { params })
export const getUserIndicatorResults = (userId, params) => http.get(`/users/${userId}/indicator-results`, { params })
export const getOrder = (orderId) => http.get(`/orders/${orderId}`)